﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ExamManagementSystem
{
    /// <summary>
    /// 管理员主窗体
    /// </summary>
    public partial class AdminForm : Form
    {
        public AdminForm()
        {
            InitializeComponent();
        }

        // 设置状态栏的标签的文本，显示当前登录的用户名
        private void AdminForm_Load(object sender, EventArgs e)
        {
            this.slblAdmin.Text = string.Format("管理员{0}登陆了",UserHelper.loginId.ToString());
           
        }

        // 关闭窗体时，退出应用程序
        private void AdminForm_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        // 用户单击退出菜单项时，退出应用程序
        private void tsmiExit_Click(object sender, EventArgs e)
        {
            DialogResult choice;　　// 用户的选择
            choice = MessageBox.Show("确定要退出吗？", "退出系统", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);

            if (choice == DialogResult.OK)
            {
                Application.Exit();  // 退出应用程序
            }            
           
        }


        // “关于MySchool”菜单项的Click事件处理
        private void tsmiAbout_Click(object sender, EventArgs e)
        {

            
        }

        // 用户单击查看教师信息时，显示教师信息列表窗体    
        private void tsmiTeacherList_Click(object sender, EventArgs e)
        {
            TeacherListForm tf = new TeacherListForm();
            tf.Show();
           
        }


        private void msAdmin_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }

        

        private void tsmiNewTeacher_Click(object sender, EventArgs e)
        {
            AddTeacherForm adf = new AddTeacherForm();
            adf.Show();
        }

        private void tsbtnNewTeacher_Click(object sender, EventArgs e)
        {
            AddTeacherForm adf = new AddTeacherForm();
            adf.Show();
        }
    
    }
}
